# def tell_story(ss ='灵剑'):
#     print('从前有座'+ ss +'山')
# tell_story()
# tell_story('王屋')
# # print('从前有座山')


# def add(a,b):
#     c=a+b
#     yield c
    
# f=add(1,2)
# print(f)

# def add1(a:int,b:int):
#     """
#     这是add的说明
#     """
#     return a+b

# x=add1(1,2)
# t=add1('hello','good')
# print(x,t)
# help(add)

#debug测试部分断点
# def test1():
#     print('1开始')
#     print('1结束')

# def test2():
#     print('2开始')
#     test1()
#     print('2结束')

# test2()



# # [n,m)的和 2+3+4+。。。
# def add_num(n,m):
#     c=(n+m)*((m-n)+1)/2-m
#     return c

# k=add_num(3,4)
# print(k)

# #n的阶乘 4！
# def fac(n):
#     x=1
#     for i in range(1,n+1)
#     x*=i
#     return x

# # n的阶乘的和 1！+2！+3！
# def fac_1(n):
#     x=1
#     for i in range(1,n+1):
#         y=1
#         for j in range(i,n+1):
#             y*=j
#         return y
#         x+=y
#     return x

# k=fac_1(5)
# print(k)

# # 局部变量和全局变量
# a=100
# def test():
#     x='hello'
#     print('x={}'.format(x))
#     # print('内部变量1={}'.format(a))
#     # global a
#     a=33
#     print('内部变量2={}'.format(a))
    
#     a=88
#     print('内部变量2={}'.format(a))
#     print('locals={},global={}'.format(locals(),globals()))

# # print('全局变量={}'.format(a))
# test()
# # print('全局变量={}'.format(a))



# 多个返回值
# def test(a,b):
#     x=a//b
#     y=a%b
#     returnx,y
#     # return (x,y)
#     # return [x,y]
#     # return 'k'=x,'p'=y



# result = test(13,5)
# print(result)



# # 默认参数使用

# def say('hangzhi','puke','jack','11')  #位置
# def say(city='changzhi',name='jack',age='11')  #关键字
# def say(changzhi,puke,name='jack',age='11')  #混合  位置必须放前面


# # 可变参数
# def add(a,b,*args,mil=2,**kwargs):
#     print('args={}'.format(args))
#     c=a+b
#     for i in args:
#         c+=i
#     return c + mil

# kk=add(1,2,3,4,5,mil=3,x=6,y=7)
# print(kk)


# # 可变类型和不可变类型传参
# def test(a):
#     a=100
#     return a

# def demo(nums):
#     nums[0]=55

# x=1
# test(x)
# print(x)
# k=test(x)
# print(k)

# y=[8,4,5]
# demo(y)
# print(y)